package com.woniuxy.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.admin.entity.AdminLogin;
import com.woniuxy.admin.mapper.AdminLoginMapper;
import com.woniuxy.admin.service.AdminLoginService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ...
 * @since 2024年05月22日
 */
@Service
public class AdminLoginServiceImpl extends ServiceImpl<AdminLoginMapper, AdminLogin> implements AdminLoginService {



    /**
     * 分页查询管理员登录日志
     * @param pageNum 分页页码
     * @param pageSize 每页个数
     * @return
     */
    @Override
    public Page<AdminLogin> loadAllAdminLogin(Integer pageNum, Integer pageSize) {
        Page<AdminLogin>page=new Page<>(pageNum,pageSize);
        QueryWrapper<AdminLogin> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("login_time");
        this.page(page,wrapper);
        return page;
    }
}
